import $store from '@/store/index.js';
import friendSqlite from '@/sqlite_services/friend.js'
//加入分组
const handle = async(data)=>{
	try{
		//修改userInfo表的分组信息
		friendSqlite.editUserInfo(data.operated_id,{
			friend_group_id: data.group_id,
			friend_group_name: data.group_name
		})
		//更改store存的这个信息
		$store.commit('updateFriendInfo',{
			friend_group_id: data.group_id,
			friend_group_name: data.group_name,
			user_id:data.operated_id,
		})
		//更新好友列表
		$store.dispatch('updateFriendList', { friend_idx:data.operated_id, data: {
			friend_group:data.group_id
		}});
	}catch(e){
		
	}
}
export default handle